var urls = "http://localhost:8888/yihuan/";

$("#send_key").click(function () {
    var compCode = $("#compCode").val();  //商铺密钥
    var data = {
        "compCode": compCode
    };
    $.ajax({
        url: urls + "updateCompanyByCompStateAndCode",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        data: JSON.stringify(data),
        async: false,
        success: function (data) {
            if (data.code == 200) {
                window.open(urls + "Background-home.html");
                window.open("", "_self").close();
                window.open("about:blank", "_top").close();
            } else {
                Swal.fire("提示", "请输入商铺密钥", "error");
            }

        }
    });
});